﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using StoreApp.DAL;
using System.Threading;
using System.Globalization;

namespace StoreApp.Controllers
{
    public class HomeController : Controller
    {
        private readonly IProductRepository productRepository;

        public HomeController(IProductRepository productRepository)
        {
            this.productRepository = productRepository;

            //This is example app, thats why i insterted culture info here.
            Thread.CurrentThread.CurrentCulture = new CultureInfo("tr-TR");
            Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;

        }
        
        public ActionResult Index()
        {
            return View(productRepository.All.ToList());
        }

    }
}
